<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" id="vp" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<title>贝达教育</title>
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />

<style>
	#takeaddress{
		font-size: 14px;
		background: #fff;
	}
	.addaddress{
		margin-right: 0.3rem;
		font-size: 14px;
	}
	.takeaddresslist{
		padding-top: 44px;
	}
	.takeaddresslist li{
		padding: 0.3rem 0.3rem;
		position: relative;
		 
		border-bottom: solid 1px #939393;
	} 
	.takename{
		padding-right: 0.2rem;
	}
	.taketel{
		font-size: 12px;
		color: #939393;
	}
	.takeaddresscontent{
		font-size: 12px;
		width: 90%;
		display: inline-block;
		padding-top:5px;
	}
	.editor{
		position: absolute;
		right: 0.2rem;
		top: 35%;
		font-size: 12px;
		color: #939393;
	}
	.editor span{
		font-size: 20px;
		color: #efefef;
		padding-right: 0.2rem;
	}
	.moren{
		font-size: 10px;
		background: #fff0ec;
		color:#e75b00;
		padding: 2px;
	}
</style>
</head>
<body>
<div id="takeaddress" class="">   
    <!--head-开始-->
    <div class="header">
    	
        <div class="heand_con" style="text-align: center;width: auto;padding: 0;"> 
        	<div class="mui-back mui-action-back mui-icon mui-icon-left-nav mui-pull-left heand_left fl" style="position: absolute;left: 0.1rem;padding-left: 0;">
        		<img src="../../../images/icon/Back_j.png">
        	</div>
        	<span style="display: inline-block; text-align: center;width: 100%;">收货地址</span>
        	<div class="addaddress fr" @tap="editoradd()" style="position: absolute;right: 0; top: 0;">
           	增加新地址
        	</div> 
        </div>  
        
        <div class="clear"></div>
    </div>
    <!--head-结束-->
	<div class="takeaddresslist">
		<ul>
			<li v-for="item in address" @tap="editoraddress(item)">
				<span class="takename">{{item.receive_name}}</span><span class="taketel">{{item.receive_phone}}</span>
				<div>
					<span v-if="item.value==1" class="moren">默认</span>
					<span class="takeaddresscontent">{{item.receive_address}}</span>
				</div>
				<div class="editor">
					<span>|</span>
					编辑
				</div>
			</li>
		</ul>
	</div> 
</div>
    <script src="../../../js/mui.js"></script>   
	<script src="../../../js/app.js"></script>
	<script src="../../../js/vue.min.js"></script>
	<script src="../../../js/token.js"></script>
	<script>
		mui.plusReady(function(){         
			state = app.getState(); 
			uid = state.userid;   
			memberToken = state.memberToken 
			mui.post(Apiurl+'shop/addresslist', {
					uid:uid,
					memberToken:memberToken,
				}, function(data) {
					 console.log(JSON.stringify(data)) 
					if(data.list && data.list.length>0){ 
						takeaddress.address=data.list
					}
				}, 'json');
		}) 
		var takeaddress = new Vue({
			el:'#takeaddress',
			data:{
				address:[],
			}, 
			methods:{
				editoraddress: function(item){ 
						var name=item.receive_name;
						var tel=item.receive_phone;
						var province=item.province;
						var xiangxiaddress=item.receive_address;
						var listid=item.id;
						var value=item.value;
						mui.openWindowWithTitle({
						url: 'editoraddress.html',  
						id: 'editoraddress',
						preload: true,
						show: {
							aniShow: 'pop-in',
							autoShow: true
						},
						extras: {
							name: name,
							tel: tel,
							pro:province,
							xiangxiaddress:xiangxiaddress,
							listid:listid,
							value:value
						},
						waiting: {
							autoShow: true 
						}
					});
				},
				editoradd: function(){
					mui.openWindowWithTitle({
						url: 'editoraddressother.html',  
						id: 'editoraddressother',
						preload: true,
						show: { 
							aniShow: 'pop-in',
							autoShow: true
						},
						waiting: {
							autoShow: true
						}   
					});  
				} 
			}  
		})
		window.addEventListener('refreshaddress', function(event) {
			mui.post(Apiurl+'shop/addresslist', {
				uid:uid,
				memberToken:memberToken,  
			}, function(data) {
				//console.log(JSON.stringify(data)) 
					takeaddress.address=data.list
			}, 'json');
		});
	</script>
</body>


</html>
